<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<head>
<script src="/js/jquery-3.5.1.min.js"></script>
</head>

<div align="center" style="margin-top: 100px;">
    <h2>Hello!SpringBoot!</h2>
    <p>
    <a href="login">登录</a>
    <a href="register">注册</a>
    </p>

<div style="width:500px;margin:20px auto;text-align: center;margin-top:50px">
    <table align='center' border='1' cellspacing='0'>

        <tr>
            <td>id</td>
            <td style="text-align: center;">标题</td>
            <td style="text-align: center;">作者</td>
            <td style="text-align: center;">操作</td>

        </tr>
        <c:forEach items="${page.list}" var="c" varStatus="st">
            <tr>
                <td>${c.id}</td>
                <td>${c.title}</td>
                <td></td>
                <td align="center">
                    <a href="detailPost?id=${c.id}">查看</a>
                </td>
            </tr>
        </c:forEach>

    </table>
    <br>
    <div>
            <a href="?start=1">[首  页]</a>
            <a href="?start=${page.pageNum-1}">[上一页]</a>
            <a href="?start=${page.pageNum+1}">[下一页]</a>
            <a href="?start=${page.pages}">[末  页]</a>
    </div>
    <br>

</div>

</div>